'use strict'

class hotSti {

    constructor() {
        this.param = '/'
    }
    //创建资源
    async get(c) {
        try {
            var a = [];
            var num2 = [18, 3, 21, 7, 29, 14];
            var click=[21,19,13,14,14,9];
            for (var j = 0; j < 6; j++) {
                let sqltext2 =`SELECT *  FROM sticker WHERE sticker_id = ${num2[j]}`;
                var r2 = await c.service.psql.query(sqltext2);
                if (r2.rowCount === 0) {
                    return c.status(500).send('sticker not found')
                }
                r2.rows[0].click=click[j];
                a.push(r2.rows[0]);
            }
            return c.send(a);
        } catch (err) {
            console.log(err)
            return c.status(500).send('err');
        }
    }
}


module.exports = hotSti